import request from '@/utils/request'

// 初始化上传文件
export function initUpload(data?: Record<string, any>) {
    return request.post({ url: '/storage/initUpload', data })
}

// 分片文件合并
export function completeUpload(data: Record<string, any>) {
    return request.put({ url: '/storage/multipart/complete', data })
}

// 上传文件
export function batchAdd(data: Record<string, any>) {
    return request.post({ url: '/file/batchAdd', data })
}

// 图片上传
export function uploadImg(data: FormData) {
    return request.post({ 
        url: '/storage/uploadImg', 
        data,
        headers: {
            'Content-Type': 'multipart/form-data'
        }
    })
}
